package com.liao.sharding;

import com.liao.sharding.config.UserAlgorithm;
import org.apache.shardingsphere.api.sharding.standard.PreciseShardingAlgorithm;
import org.mybatis.spring.annotation.MapperScan;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.scheduling.annotation.EnableAsync;
import org.springframework.transaction.annotation.EnableTransactionManagement;

@SpringBootApplication
@EnableTransactionManagement
@EnableAsync
@MapperScan("com.liao.sharding.dao")
public class LiaoApplication {

    public static void main(String[] args) {
        SpringApplication.run(LiaoApplication.class, args);
    }

    @Bean
    public PreciseShardingAlgorithm preciseShardingAlgorithm(){
        return new UserAlgorithm();
    }
}
